/****************************************************************************
**
** Copyright (c) 2009-2013, Jaco Naudé
**
** This file is part of Qtilities.
**
** For licensing information, please see
** http://jpnaude.github.io/Qtilities/page_licensing.html
**
****************************************************************************/

#ifndef INAMINGPOLICYDIALOG_H
#define INAMINGPOLICYDIALOG_H

#include "QtilitiesCoreGui_global.h"
#include "QtilitiesCoreGuiConstants.h"
#include "NamingPolicyFilter.h"

#include <IObjectBase>

#include <QDialog>

namespace Qtilities {
    namespace CoreGui {
        namespace Interfaces {
            using namespace Qtilities::Core::Interfaces;

            /*!
            \class INamingPolicyDialog
            \brief NamingPolicyFilter classes uses implementations of this interface in order to prompt users for actions during naming conflicts.

            <i>This class was added in %Qtilities v1.0.</i>
              */
            class QTILITIES_CORE_GUI_SHARED_EXPORT INamingPolicyDialog: public QDialog, virtual public IObjectBase
            {
            public:
                INamingPolicyDialog(QWidget *parent = 0) : QDialog(parent) {}
                virtual ~INamingPolicyDialog() {}

                //! Indicates if the "All in this cycle" check box is selected.
                virtual bool useCycleResolution() const = 0;
                //! Unchecks the "All in this cycle" check box.
                virtual void endValidationCycle() = 0;
                //! Returns the current auto generated name.
                virtual QString autoGeneratedName() const = 0;
                //! Returns the currect selected resolution.

                virtual NamingPolicyFilter::ResolutionPolicy selectedResolution() const = 0;
                //! Sets the naming policy filter from which this dialog was constructed.
                virtual void setNamingPolicyFilter(NamingPolicyFilter* naming_policy_subject_filter)  = 0;
                //! Sets the current object which is causing the conflict.
                virtual void setObject(QObject* obj) = 0;
                //! Sets the context in which the naming policy filter is used.
                virtual void setContext(int context_id, const QString& context_name, const QIcon& window_icon = QIcon()) = 0;
                //! Initializes the dialog with the speficic validity.
                virtual bool initialize(NamingPolicyFilter::NameValidity validity_result) = 0;

            };
        }
    }
}

Q_DECLARE_INTERFACE(Qtilities::CoreGui::Interfaces::INamingPolicyDialog,"com.Qtilities.CoreGui.INamingPolicyDialog/1.0");

#endif // INAMINGPOLICYDIALOG_H
